package com.itcodai.config.json;

/**
 * @author c-fanqj
 * @date 2021/12/17
 * @apiNote jackson对null处理为""
 * 使用阿里巴巴的fastJson时，把jackson的配置注释掉
 */
/*
@Configuration
public class JacksonConfig {
    @Bean
    @Primary
    @ConditionalOnMissingBean(ObjectMapper.class)
    public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
        ObjectMapper objectMapper = builder.createXmlMapper(false).build();
        objectMapper.getSerializerProvider().setNullValueSerializer(
            new JsonSerializer<Object>() {
                @Override
                public void serialize(Object value, JsonGenerator gen,
                                      SerializerProvider serializers) throws IOException {
                    gen.writeString("");
                }
            });
        return objectMapper;
    }
}*/
